<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use DB;


class RoleMenu extends Authenticatable
{
    use Notifiable;
	protected $table = 'admin_role_menu';


    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
         'remember_token',
    ];


    // 获取指定角色的菜单ID
	public static function getRoleMenuId($rid){
		$menu_id = DB::table('admin_role_menu')
			->where('admin_role_menu.role_id',$rid)
			->select('admin_role_menu.menu_id')
			->get()
			->toArray();
		if(!$menu_id){
			return array();
		}
		return $menu_id;
	}


}
